package topcoder;

import java.util.Arrays;

public class SRMRoomAssignmentPhase {

	public int countCompetitors(int[] ratings, int K){
		int me = ratings[0];
		Arrays.sort(ratings);
		for (int i = 0; i < ratings.length; i++) {
			if(ratings[i] == me){
				me = ratings.length - i - 1;
				break;
			}
		}
		return (int)(me/K);
	}
	
	public static void main(String[] args) {
		SRMRoomAssignmentPhase test = new SRMRoomAssignmentPhase();
		int[] ratings = {491, 981, 1199, 763, 994, 879, 888};
		test.countCompetitors(ratings, 3);
	}
}
